	<?php $this->load->view('admin/partials/bid_menu'); ?>
	<?php 
		$ci = &get_instance();
		$ci->load->library('module_helper');
		
		$email_array = array();
		foreach($items as $obj){
			$email_array[$obj->email_slug] = array( 'status'=> $obj->status, 'sent_date'=>$obj->sent_date);
		}
	?>
	<h3>Bid &raquo; <?php echo ucfirst($this->uri->segment(4,''));?></h3>

	<div class="clrboth"></div>
	
	<table border="0" class="table-list">
		<thead>
			<tr>
				<th>Name</th>
				<th>Description</th>
				<th>Status</th>
				<th>Sent Date</th>
				<th>Manage</th>
			</tr>
		</thead>
		
		<tbody>
			<?php foreach( emailSlugAdminHandleSendDataConfig() as $item ): ?>
			<?php 
				$template = $ci->module_helper->getTemplateMail( $item );			
			?>
			<tr>
				<td><?php echo $template['name']; ?></td>
				<td><?php echo $template['description']; ?></td>
				<td><?php 
						if(isset($email_array[$template['slug']])){
							echo $email_array[$template['slug']]['status'];
							if( intval( $email_array[$template['slug']]['sent_date'] )< 1000 ){
								$sent_date = "";
							}else{
								$sent_date = sbxDateFormat($email_array[$template['slug']]['sent_date'],'d-M-Y');
							}
						}else{
							echo 'Pending';
							$sent_date = "";
						}
					?>
				</td>
				<td><?php echo $sent_date; ?></td>
				<td>
					<a href="<?php echo site_url("admin/dataman/bid/compose/?show_id=".$_GET['show_id']."&bid_id=".$_GET['bid_id'])."&slug=".$template['slug'];?>">Compose</a>
				</td>
			</tr>
			<?php endforeach; ?>
		</tbody>
	</table>


